package zhuhai.tedu.parttimess.domain.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.BeanUtils;
import zhuhai.tedu.parttimess.domain.User;


@ApiModel(value = "用户")
public class UserVo {

    @ApiModelProperty(value = "ID")
    private Integer id;
    @ApiModelProperty(value = "用户名")
    private String name;  //用户名
    @ApiModelProperty(value = "密码")
    private String password; //密码
    @ApiModelProperty(value = "是否是管理员")
    private Integer administrator;//是否是管理员
    @ApiModelProperty(value = "盐")
    private String salt;//加盐


    public UserVo(){

    }

    public UserVo(User user){
        if(null!=user){
            BeanUtils.copyProperties(user,this);
        }
    }


    public User toUser(){
        User user=new User();
        BeanUtils.copyProperties(this,user);
        return user;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getAdministrator() {
        return administrator;
    }

    public void setAdministrator(Integer administrator) {
        this.administrator = administrator;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }
}
